package com.wjbgn.bsolver.gateway.config.webclient;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.client.WebClient;

/**
 * webclient初始化配置
 *
 * @author weirx
 * @date 2022/03/14 10:19
 **/
@Component
public class WebClientConfig {

    /**
     * 3.1.1版本不能使用feignClient，所以此处选择webclient作为服务掉哟个，此处初始化全局WebClient.Builder
     *
     * @param
     * @return org.springframework.web.reactive.function.client.WebClient.Builder
     * @author weirx
     * @date: 2022/3/14
     */
    @Bean
    @LoadBalanced
    public WebClient.Builder loadBalancedWebClientBuilder() {
        return WebClient.builder();
    }
}
